FROM library/node:12

MAINTAINER      Dongasai "1514582970@qq.com"

# 安装常用工具
RUN apt update
RUN apt install -y vim dos2unix
WORKDIR /home/
RUN npm install -g cnpm --registry=https://registry.npm.taobao.org
RUN cnpm install -g yarn supervisor bower
# 安装依赖
COPY package.json /home/
COPY yarn.lock /home/
WORKDIR /home/
RUN yarn
# 安装依赖完成
# 进行文件复制和环境变量初始化
COPY . /home/
WORKDIR /home/public/
RUN bower install --allow-root
WORKDIR /home/
CMD npm run start